home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------------------
-
- Program: CPlusTESample 2.0
- File: TESample.h
- Uses: Application.h
- TECommon.h
-
- by Andrew Shebanow
- of Apple Macintosh Developer Technical Support
- with modifications by Eric Berdahl
-
- Copyright © 1989-1990 Apple Computer, Inc.
- Copyright © 1992 Eric Berdahl
- All rights reserved.
-
- ------------------------------------------------------------------------------------------*/
-
- #ifndef __TESAMPLE__
- #define __TESAMPLE__
-
- // we need resource definitions
- #ifndef __TECOMMON__
- #include "TECommon.h"
- #endif
-
- // Since we are based on the Application class, we need its class definitions
- #ifndef __APPLICATION__
- #include "Application.h"
- #endif
-
- // we need object model support
- #ifndef __UAPPLEOBJECT__
- #include "UAppleObject.h"
- #endif
-
-
- // TESample is our application class. It is a subclass of TApplication,
- // so it only needs to specify its behaviour in areas where it is different
- // from the default.
- class TESample : public TApplication, public MAppleObject {
- public:
- TESample(); // Our constructor
-
- static TESample* GetTEApplication();
-
- // the actual methods referenced via AppleEvents
- virtual void DoFinderNew(const AppleEvent& message, AppleEvent& reply);
- virtual void DoFinderOpen(const AppleEvent& message, AppleEvent& reply);
- virtual void DoFinderPrint(const AppleEvent& message, AppleEvent& reply);
- virtual void DoFinderQuit(const AppleEvent& message, AppleEvent& reply);
- virtual void DoAppleNewElement(const AppleEvent& message, AppleEvent& reply);
-
- // more details for Object Model support
- virtual MAppleObject* GetWindowObject(DescType keyForm, const AEDesc& keyData);
-
- // Object Model support
- virtual DescType GetAppleClass() const;
- virtual long CountContainedObjects(DescType ofType);
- virtual void DoAppleEvent(const AppleEvent& message,
- AppleEvent& reply,
- long refCon);
- virtual MAppleObject* GetContainedObject(DescType desiredType,
- DescType keyForm,
- const AEDesc& keyData,
- Boolean& needDisposal);
- virtual Boolean CompareAppleObjects(DescType operation,
- const MAppleObject& toWhat);
-
- private:
- // routines from TApplication we are overriding
- long HeapNeeded();
- unsigned long SleepVal();
- void DoIdle();
- void AdjustCursor();
- void AdjustMenus();
- void DoMenuCommand(short menuID, short menuItem);
- void OpenADoc(short vRefNum, long dirID, StringPtr fName, OSType fType);
-
- // routines for our own devious purposes
- void DoNew();
- void DoOpen();
- };
-
-
- WindowPtr GetWindowFromName(Str255 name);
- WindowPtr GetWindowFromIndex(short index);
-
- #endif
-